﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DestroyAfter : MonoBehaviour 
{
	public float duration = 5;


	void Awake () 
	{
		StartCoroutine(WaitThenDestroy());
	}
	IEnumerator WaitThenDestroy()
	{
		yield return new WaitForSeconds(duration);
		Destroy(this.transform.gameObject);
	}
}
